package org.sixtythousand.joker.http;

import org.sixtythousand.joker.JChannel;
import org.sixtythousand.joker.Request;

import java.net.HttpCookie;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

/**
 * @author zhoulk
 * @date 2023/10/13 15:26
 * @desc
 */
public interface HttpRequest extends Request {

    HttpChannel getChannel();

    HttpRequest method(String method);


    /**
     * @return the URI scheme of this request, such as "http" or "https"
     */
    String getScheme();

    HttpRequest scheme(String scheme);

    String getHost();


    /**
     * @param host the URI host of this request, such as "127.0.0.1" or "google.com"
     * @return this request object
     */
    Request host(String host);

    int getPort();

    String getMethod();

    String getPath();

    HttpRequest path(String path);

    Fields getParams();


    HttpRequest param(String name, String value);

    HttpFields getHeaders();

    HttpRequest headers(Consumer<HttpFields> consumer);

    HttpRequest header(String name, String value);




    HttpRequest cookie(HttpCookie cookie);

    HttpRequest attribute(String name, Object value);

    Map<String, Object> getAttributes();


}
